﻿using System;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows;
using CodeCounsel.SharePoint.RibbonDesigner.ViewModel;

namespace CodeCounsel.SharePoint.RibbonDesigner.View.AttachedBehaviors
{
    class ItemsControlDragManager
            : DragManager
    {
        public ItemsControl SourceItemsControl { get; set; }

        public ItemsControlDragManager(ItemsControl sourceItemsControl, Visual originalSource, 
            IDragProcessor dragProcessor)
            : base(dragProcessor)
        {
            SourceItemsControl = sourceItemsControl;
            SourceItemContainer = (FrameworkElement)sourceItemsControl.ContainerFromElement(originalSource);
            DraggedData = SourceItemContainer.DataContext;
        }
    }
}
